import axios from './axios';

// 查询列表
export function getImageClassList(page:any){
  return axios.get("/admin/image_class/"+page)
}
// 新增
export function createImageClassList(data:any){
  return axios.post("/admin/image_class",data)
}
// 修改
export function updataImageClassList(id:any, data:any){
  return axios.post("/admin/image_class/"+id, data)
}
// 删除
export function deteleImageClassList(id:number){
  return axios.post(`/admin/image_class/${id}/delete`)
}
// 指定分类下的图片列表
export function getImageList(id:number, page: number = 1){
  return axios.get(`/admin/image_class/${id}/image/${page}`)
}
// 修改图片名称
export function updateImageName(id:number,name:any){
  return axios.post(`/admin/image/${id}`, { name } )
}
// 删除图片
export function deleteImageName(ids:any,){
  return axios.post('/admin/image/delete_all',{ ids })
}
// 上传图片
export const uploadImageAction =  '/api/admin/image/upload'